wxMenuItem
Table of Contents

wxMenuItems must have a wxMenu parent.


Parameters for creating a new menuitem: To create a submenu, you first need to create a wxMenu with no parent, and pass the result in the subMenu parameter. To set up event handlers for menus, use the wxEVT_COMMAND_MENU_SELECTED event type. wxMenu controls now derive from wxEvtHandler, so you should set events with the menu now, not a parent control. code ex: procedure on_open_menu( atom this, atom event ) -- do stuff end procedure -- if you used a specific wxID_ constant when you created the wxMenuItem, you could -- use that instead of get_menuitem_id: wxID_OPEN, wxID_NEW, etc set_event_handler( the_open_menu_parent, get_menuitem_id( the_open_menu ), wxEVT_COMMAND_MENU_SELECTED, routine_id("on_open_menu")) endcode

 
 
Parent Topics:
  • Classes
  • Menus